﻿#include "seqbase/rendercxt.h"
#include "draw.h"

using namespace anip;

void GraphicsRenderContext::beginRender(RenderBuffer& target)
{
	assert(_target == nullptr);
	_target = &target;
	target.beginRender();
	target.transformReset();
	// convert the coordinate system
	target.transformPushCombined(
		Transform2D({ 0, 0 }, { _aspectScale }));
	target.transformPushCombined(transform);
}

void GraphicsRenderContext::endRender()
{
	assert(_target != nullptr);
	_target->endRender();
	_target = nullptr;
}